package com.heima.minio.test;

import com.heima.article.ArticleApplication;
import com.heima.file.service.FileStorageService;
import com.heima.model.article.pojos.ApArticleContent;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.io.FileInputStream;
import java.io.FileNotFoundException;

@SpringBootTest(classes = ArticleApplication.class)
@RunWith(SpringJUnit4ClassRunner.class)
public class MinIOTest2 {

    @Autowired
    private FileStorageService fileStorageService;

    @Test
    public void testUpload() throws FileNotFoundException {
        FileInputStream fileInputStream = new FileInputStream("d:\\index.html");

        String path = fileStorageService.uploadHtmlFile("", "list.html", fileInputStream);
        System.out.println(path);
    }

}
